#include <stdio.h>
#include <string.h>
#include <stdlib.h>

void create_file(char *,char *);
void create_string(char *);

int main()
{
	for(int i=0;i<10000;i++)
	{
		char *s;
		s=(char *)malloc(500000);
		create_string(s);
		char a[20];
		sprintf(a,"out/r_1_%d",i);
		create_file(s,a);
	}
	return 0;

}

void create_file(char *s,char *fname)
{
	FILE *fp;
	fp=fopen(fname,"a+");
	fwrite(s,1,strlen(s),fp);
	fclose(fp);
}

void create_string(char *s)
{
	for(int i=0;i<50000;i++)
	{
		char a[5];
		sprintf(a,"%d",rand()%10000);
		strcat(s,a);
		strcat(s,"\t");
		if(i%5==4)
			strcat(s,"\n");
	}
}
